<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="unqualified">
	<xs:complexType name="AndType">
		<xs:choice minOccurs="0" maxOccurs="unbounded">
			<xs:group ref="LogicalGroup"/>
			<xs:group ref="OperatorGroup"/>
		</xs:choice>
	</xs:complexType>
	<xs:complexType name="ArgumentType">
		<xs:attribute name="valueId" type="xs:NMTOKEN"/>
		<xs:attribute name="type" default="String">
			<xs:simpleType>
				<xs:restriction base="xs:NMTOKEN">
					<xs:enumeration value="Integer"/>
					<xs:enumeration value="Short"/>
					<xs:enumeration value="Byte"/>
					<xs:enumeration value="Long"/>
					<xs:enumeration value="String"/>
					<xs:enumeration value="Exception"/>
					<xs:enumeration value="Double"/>
					<xs:enumeration value="Single"/>
					<xs:enumeration value="Decimal"/>
					<xs:enumeration value="Boolean"/>
					<xs:enumeration value="DateTime"/>
				</xs:restriction>
			</xs:simpleType>
		</xs:attribute>
		<xs:attribute name="value" type="xs:string"/>
	</xs:complexType>
	<xs:complexType name="AssertType">
		<xs:sequence>
			<xs:element name="Argument" type="ArgumentType" minOccurs="0" maxOccurs="unbounded"/>
		</xs:sequence>
		<xs:attribute name="id" type="xs:NMTOKEN" use="required"/>
		<xs:attribute name="valueId" type="xs:NMTOKEN"/>
		<xs:attribute name="type" type="xs:string" use="required"/>
		<xs:attribute name="value" type="xs:string"/>
	</xs:complexType>
	<xs:complexType name="BetweenType">
		<xs:choice minOccurs="0" maxOccurs="unbounded">
			<xs:group ref="AssertGroup"/>
		</xs:choice>
		<xs:attribute name="valueId" type="xs:NMTOKEN" use="required"/>
		<xs:attribute name="leftId" type="xs:NMTOKEN" use="required"/>
		<xs:attribute name="rightId" type="xs:NMTOKEN" use="required"/>
		<xs:attribute name="excludeLeft" default="false">
			<xs:simpleType>
				<xs:restriction base="xs:NMTOKEN">
					<xs:enumeration value="true"/>
					<xs:enumeration value="false"/>
				</xs:restriction>
			</xs:simpleType>
		</xs:attribute>
		<xs:attribute name="excludeRight" default="false">
			<xs:simpleType>
				<xs:restriction base="xs:NMTOKEN">
					<xs:enumeration value="true"/>
					<xs:enumeration value="false"/>
				</xs:restriction>
			</xs:simpleType>
		</xs:attribute>
	</xs:complexType>
	<xs:complexType name="BooleanType">
		<xs:attribute name="id" type="xs:NMTOKEN" use="required"/>
		<xs:attribute name="value" type="xs:string" use="required"/>
	</xs:complexType>
	<xs:complexType name="ByteType">
		<xs:attribute name="id" type="xs:NMTOKEN" use="required"/>
		<xs:attribute name="value" type="xs:byte" use="required"/>
	</xs:complexType>
		<xs:complexType name="CompareType">
		<xs:choice minOccurs="0" maxOccurs="unbounded">
			<xs:group ref="AssertGroup"/>
		</xs:choice>
		<xs:attribute name="leftId" type="xs:NMTOKEN" use="required"/>
		<xs:attribute name="operator" type="xs:string" use="required"/>
		<xs:attribute name="rightId" type="xs:NMTOKEN" use="required"/>
	</xs:complexType>
	<xs:complexType name="DateType">
		<xs:attribute name="id" type="xs:NMTOKEN" use="required"/>
		<xs:attribute name="value" type="xs:date" use="required"/>
	</xs:complexType>
	<xs:complexType name="DateTimeType">
		<xs:attribute name="id" type="xs:NMTOKEN" use="required"/>
		<xs:attribute name="value" type="xs:dateTime" use="required"/>
	</xs:complexType>
	<xs:complexType name="TimeType">
		<xs:attribute name="id" type="xs:NMTOKEN" use="required"/>
		<xs:attribute name="value" type="xs:time" use="required"/>
	</xs:complexType>
	<xs:complexType name="DecimalType">
		<xs:attribute name="id" type="xs:NMTOKEN" use="required"/>
		<xs:attribute name="value" type="xs:decimal" use="required"/>
	</xs:complexType>
	<xs:complexType name="DoType">
		<xs:choice minOccurs="0" maxOccurs="unbounded">
			<xs:group ref="NxBREGroup"/>
		</xs:choice>
	</xs:complexType>
	<xs:complexType name="DoubleType">
		<xs:attribute name="id" type="xs:NMTOKEN" use="required"/>
		<xs:attribute name="value" type="xs:double" use="required"/>
	</xs:complexType>
	<xs:complexType name="ElseType">
		<xs:choice minOccurs="0" maxOccurs="unbounded">
			<xs:group ref="NxBREGroup"/>
		</xs:choice>
	</xs:complexType>
	<xs:complexType name="ElseIfType">
		<xs:sequence>
			<xs:group ref="LogicalGroup"/>
			<xs:element name="Do" type="DoType"/>
		</xs:sequence>
	</xs:complexType>
	<xs:complexType name="EqualsType">
		<xs:choice minOccurs="0" maxOccurs="unbounded">
			<xs:group ref="AssertGroup"/>
		</xs:choice>
		<xs:attribute name="leftId" type="xs:NMTOKEN" use="required"/>
		<xs:attribute name="rightId" type="xs:NMTOKEN" use="required"/>
	</xs:complexType>
	<xs:complexType name="EvaluateType">
		<xs:sequence>
			<xs:element name="Parameter" type="ParameterType" minOccurs="0" maxOccurs="unbounded"/>
		</xs:sequence>
		<xs:attribute name="id" type="xs:NMTOKEN" use="required"/>
	</xs:complexType>
	<xs:complexType name="ExceptionType">
		<xs:attribute name="id" type="xs:NMTOKEN" use="required"/>
		<xs:attribute name="value" type="xs:string" use="required"/>
	</xs:complexType>
	<xs:complexType name="FalseType">
		<xs:attribute name="id" type="xs:NMTOKEN" use="required"/>
	</xs:complexType>
	<xs:complexType name="ForEachType">
		<xs:choice minOccurs="0" maxOccurs="unbounded">
			<xs:group ref="NxBREGroup"/>
		</xs:choice>
		<xs:attribute name="id" type="xs:NMTOKEN" use="required"/>
		<xs:attribute name="valueId" type="xs:NMTOKEN" use="required"/>
	</xs:complexType>
	<xs:complexType name="GreaterThanType">
		<xs:choice minOccurs="0" maxOccurs="unbounded">
			<xs:group ref="AssertGroup"/>
		</xs:choice>
		<xs:attribute name="leftId" type="xs:NMTOKEN" use="required"/>
		<xs:attribute name="rightId" type="xs:NMTOKEN" use="required"/>
	</xs:complexType>
	<xs:complexType name="GreaterThanEqualToType">
		<xs:choice minOccurs="0" maxOccurs="unbounded">
			<xs:group ref="AssertGroup"/>
		</xs:choice>
		<xs:attribute name="leftId" type="xs:NMTOKEN" use="required"/>
		<xs:attribute name="rightId" type="xs:NMTOKEN" use="required"/>
	</xs:complexType>
	<xs:complexType name="IfType">
		<xs:sequence>
			<xs:group ref="LogicalGroup"/>
			<xs:element name="Do" type="DoType"/>
		</xs:sequence>
	</xs:complexType>
	<xs:complexType name="InType">
		<xs:choice minOccurs="0" maxOccurs="unbounded">
			<xs:group ref="AssertGroup"/>
		</xs:choice>
		<xs:attribute name="valueId" type="xs:NMTOKEN" use="required"/>
		<xs:attribute name="idList" type="xs:string" use="required"/>
	</xs:complexType>
	<xs:complexType name="IncrementType">
		<xs:attribute name="id" type="xs:NMTOKEN" use="required"/>
		<xs:attribute name="step" type="xs:string"/>
		<xs:attribute name="value" type="xs:string"/>
		<xs:attribute name="valueId" type="xs:string"/>
	</xs:complexType>
	<xs:complexType name="InstanceOfType">
		<xs:choice minOccurs="0" maxOccurs="unbounded">
			<xs:group ref="AssertGroup"/>
		</xs:choice>
		<xs:attribute name="leftId" type="xs:NMTOKEN" use="required"/>
		<xs:attribute name="rightId" type="xs:NMTOKEN" use="required"/>
	</xs:complexType>
	<xs:complexType name="IntegerType">
		<xs:attribute name="id" type="xs:NMTOKEN" use="required"/>
		<xs:attribute name="value" type="xs:integer" use="required"/>
	</xs:complexType>
	<xs:complexType name="InvokeSetType">
		<xs:attribute name="id" type="xs:IDREF"/>
		<xs:attribute name="valueId" type="xs:NMTOKEN"/>
	</xs:complexType>
	<xs:complexType name="IsAssertedType">
		<xs:attribute name="valueId" type="xs:NMTOKEN" use="required"/>
	</xs:complexType>
	<xs:complexType name="IsFalseType">
		<xs:choice minOccurs="0" maxOccurs="unbounded">
			<xs:group ref="AssertGroup"/>
		</xs:choice>
		<xs:attribute name="valueId" type="xs:NMTOKEN" use="required"/>
	</xs:complexType>
	<xs:complexType name="IsTrueType">
		<xs:choice minOccurs="0" maxOccurs="unbounded">
			<xs:group ref="AssertGroup"/>
		</xs:choice>
		<xs:attribute name="valueId" type="xs:NMTOKEN" use="required"/>
	</xs:complexType>
	<xs:complexType name="LessThanType">
		<xs:choice minOccurs="0" maxOccurs="unbounded">
			<xs:group ref="AssertGroup"/>
		</xs:choice>
		<xs:attribute name="leftId" type="xs:NMTOKEN" use="required"/>
		<xs:attribute name="rightId" type="xs:NMTOKEN" use="required"/>
	</xs:complexType>
	<xs:complexType name="LessThanEqualToType">
		<xs:choice minOccurs="0" maxOccurs="unbounded">
			<xs:group ref="AssertGroup"/>
		</xs:choice>
		<xs:attribute name="leftId" type="xs:NMTOKEN" use="required"/>
		<xs:attribute name="rightId" type="xs:NMTOKEN" use="required"/>
	</xs:complexType>
	<xs:complexType name="LogType">
		<xs:attribute name="level" type="xs:string" use="required"/>
		<xs:attribute name="msg" type="xs:string"/>
		<xs:attribute name="msgId" type="xs:NMTOKEN"/>
	</xs:complexType>
	<xs:complexType name="LogicType">
		<xs:sequence>
			<xs:element name="If" type="IfType"/>
			<xs:choice minOccurs="0" maxOccurs="unbounded">
				<xs:element name="Else" type="ElseType"/>
				<xs:element name="ElseIf" type="ElseIfType"/>
			</xs:choice>
		</xs:sequence>
	</xs:complexType>
	<xs:complexType name="LongType">
		<xs:attribute name="id" type="xs:NMTOKEN" use="required"/>
		<xs:attribute name="value" type="xs:long" use="required"/>
	</xs:complexType>
	<xs:complexType name="MatchesType">
		<xs:choice minOccurs="0" maxOccurs="unbounded">
			<xs:group ref="AssertGroup"/>
		</xs:choice>
		<xs:attribute name="patternId" type="xs:NMTOKEN" use="required"/>
		<xs:attribute name="valueId" type="xs:NMTOKEN" use="required"/>
	</xs:complexType>
	<xs:complexType name="ModifyType">
		<xs:attribute name="id" type="xs:NMTOKEN" use="required"/>
		<xs:attribute name="type" default="String">
			<xs:simpleType>
				<xs:restriction base="xs:NMTOKEN">
					<xs:enumeration value="Integer"/>
					<xs:enumeration value="Short"/>
					<xs:enumeration value="Byte"/>
					<xs:enumeration value="Long"/>
					<xs:enumeration value="String"/>
					<xs:enumeration value="Exception"/>
					<xs:enumeration value="Double"/>
					<xs:enumeration value="Single"/>
					<xs:enumeration value="Decimal"/>
					<xs:enumeration value="Boolean"/>
					<xs:enumeration value="DateTime"/>
				</xs:restriction>
			</xs:simpleType>
		</xs:attribute>
		<xs:attribute name="valueId" type="xs:NMTOKEN"/>
		<xs:attribute name="value" type="xs:string"/>
	</xs:complexType>
	<xs:complexType name="NotType">
		<xs:choice minOccurs="0" maxOccurs="unbounded">
			<xs:group ref="LogicalGroup"/>
			<xs:group ref="OperatorGroup"/>
		</xs:choice>
	</xs:complexType>
	<xs:complexType name="NotEqualsType">
		<xs:choice minOccurs="0" maxOccurs="unbounded">
			<xs:group ref="AssertGroup"/>
		</xs:choice>
		<xs:attribute name="leftId" type="xs:NMTOKEN" use="required"/>
		<xs:attribute name="rightId" type="xs:NMTOKEN" use="required"/>
	</xs:complexType>
	<xs:complexType name="ObjectLookupType">
		<xs:sequence>
			<xs:element name="Argument" type="ArgumentType" minOccurs="0" maxOccurs="unbounded"/>
		</xs:sequence>
		<xs:attribute name="id" type="xs:NMTOKEN"/>
		<xs:attribute name="member" type="xs:NMTOKEN" use="required"/>
		<xs:attribute name="objectId" type="xs:NMTOKEN"/>
		<xs:attribute name="type" type="xs:string"/>
	</xs:complexType>
	<xs:complexType name="OrType">
		<xs:choice minOccurs="0" maxOccurs="unbounded">
			<xs:group ref="LogicalGroup"/>
			<xs:group ref="OperatorGroup"/>
		</xs:choice>
	</xs:complexType>
	<xs:complexType name="ParameterType">
		<xs:attribute name="valueId" type="xs:NMTOKEN"/>
		<xs:attribute name="name" type="xs:NMTOKEN" use="required"/>
		<xs:attribute name="value" type="xs:string"/>
	</xs:complexType>
	<xs:complexType name="RetractType">
		<xs:attribute name="id" type="xs:NMTOKEN" use="required"/>
	</xs:complexType>
	<xs:complexType name="SetType">
		<xs:choice minOccurs="0" maxOccurs="unbounded">
			<xs:group ref="NxBREGroup"/>
		</xs:choice>
		<xs:attribute name="id" type="xs:ID" use="required"/>
	</xs:complexType>
	<xs:complexType name="ShortType">
		<xs:attribute name="id" type="xs:NMTOKEN" use="required"/>
		<xs:attribute name="value" type="xs:short" use="required"/>
	</xs:complexType>
	<xs:complexType name="SingleType">
		<xs:attribute name="id" type="xs:NMTOKEN" use="required"/>
		<xs:attribute name="value" type="xs:float" use="required"/>
	</xs:complexType>
	<xs:complexType name="StringType">
		<xs:attribute name="id" type="xs:NMTOKEN" use="required"/>
		<xs:attribute name="value" type="xs:string" use="required"/>
	</xs:complexType>
	<xs:complexType name="ThrowExceptionType">
		<xs:attribute name="id" type="xs:NMTOKEN"/>
		<xs:attribute name="value" type="xs:string"/>
		<xs:attribute name="valueId" type="xs:NMTOKEN"/>
	</xs:complexType>
	<xs:complexType name="ThrowFatalExceptionType">
		<xs:attribute name="id" type="xs:NMTOKEN"/>
		<xs:attribute name="value" type="xs:string"/>
		<xs:attribute name="valueId" type="xs:NMTOKEN"/>
	</xs:complexType>
	<xs:complexType name="TrueType">
		<xs:attribute name="id" type="xs:NMTOKEN" use="required"/>
	</xs:complexType>
	<xs:complexType name="WhileType">
		<xs:sequence>
			<xs:group ref="LogicalGroup"/>
			<xs:element name="Do" type="DoType"/>
		</xs:sequence>
	</xs:complexType>
	<xs:element name="xBusinessRules">
		<xs:complexType>
			<xs:sequence minOccurs="0" maxOccurs="unbounded">
				<xs:group ref="NxBREGroup"/>
				<xs:element name="Set" type="SetType" minOccurs="0" maxOccurs="unbounded"/>
			</xs:sequence>
		</xs:complexType>
	</xs:element>
	<!--
			Groups
	-->
	<xs:group name="AssertGroup">
		<xs:sequence>
			<xs:element name="Assert" type="AssertType" minOccurs="0" maxOccurs="unbounded"/>
			<xs:element name="Evaluate" type="EvaluateType" minOccurs="0" maxOccurs="unbounded"/>
			<xs:element name="Modify" type="ModifyType" minOccurs="0" maxOccurs="unbounded"/>
			<xs:element name="ObjectLookup" type="ObjectLookupType" minOccurs="0" maxOccurs="unbounded"/>
			<xs:element name="Increment" type="IncrementType" minOccurs="0" maxOccurs="unbounded"/>
			<xs:element name="Integer" type="IntegerType" minOccurs="0" maxOccurs="unbounded"/>
			<xs:element name="Short" type="ShortType" minOccurs="0" maxOccurs="unbounded"/>
			<xs:element name="Byte" type="ByteType" minOccurs="0" maxOccurs="unbounded"/>
			<xs:element name="Long" type="LongType" minOccurs="0" maxOccurs="unbounded"/>
			<xs:element name="String" type="StringType" minOccurs="0" maxOccurs="unbounded"/>
			<xs:element name="Exception" type="ExceptionType" minOccurs="0" maxOccurs="unbounded"/>
			<xs:element name="Double" type="DoubleType" minOccurs="0" maxOccurs="unbounded"/>
			<xs:element name="Single" type="SingleType" minOccurs="0" maxOccurs="unbounded"/>
			<xs:element name="Decimal" type="DecimalType" minOccurs="0" maxOccurs="unbounded"/>
			<xs:element name="Boolean" type="BooleanType" minOccurs="0" maxOccurs="unbounded"/>
			<xs:element name="Date" type="DateType" minOccurs="0" maxOccurs="unbounded"/>
			<xs:element name="DateTime" type="DateTimeType" minOccurs="0" maxOccurs="unbounded"/>
			<xs:element name="Time" type="TimeType" minOccurs="0" maxOccurs="unbounded"/>
			<xs:element name="True" type="TrueType" minOccurs="0" maxOccurs="unbounded"/>
			<xs:element name="False" type="FalseType" minOccurs="0" maxOccurs="unbounded"/>
		</xs:sequence>
	</xs:group>
	<xs:group name="LogicalGroup">
		<xs:choice>
			<xs:element name="And" type="AndType"/>
			<xs:element name="Or" type="OrType"/>
			<xs:element name="Not" type="NotType"/>
		</xs:choice>
	</xs:group>
	<xs:group name="OperatorGroup">
		<xs:choice>
			<xs:element name="Between" type="BetweenType"/>
			<xs:element name="In" type="InType"/>
			<xs:element name="IsAsserted" type="IsAssertedType"/>
			<xs:element name="IsTrue" type="IsTrueType"/>
			<xs:element name="IsFalse" type="IsFalseType"/>
			<xs:element name="Equals" type="EqualsType"/>
			<xs:element name="NotEquals" type="NotEqualsType"/>
			<xs:element name="InstanceOf" type="InstanceOfType"/>
			<xs:element name="LessThan" type="LessThanType"/>
			<xs:element name="LessThanEqualTo" type="LessThanEqualToType"/>
			<xs:element name="GreaterThan" type="GreaterThanType"/>
			<xs:element name="GreaterThanEqualTo" type="GreaterThanEqualToType"/>
			<xs:element name="Matches" type="MatchesType"/>
			<xs:element name="Compare" type="CompareType"/>
		</xs:choice>
	</xs:group>
	<xs:group name="NxBREGroup">
		<xs:sequence>
			<xs:group ref="AssertGroup"/>
			<xs:element name="Retract" type="RetractType" minOccurs="0" maxOccurs="unbounded"/>
			<xs:element name="ThrowException" type="ThrowExceptionType" minOccurs="0" maxOccurs="unbounded"/>
			<xs:element name="ThrowFatalException" type="ThrowFatalExceptionType" minOccurs="0" maxOccurs="unbounded"/>
			<xs:element name="Log" type="LogType" minOccurs="0" maxOccurs="unbounded"/>
			<xs:element name="Logic" type="LogicType" minOccurs="0" maxOccurs="unbounded"/>
			<xs:element name="InvokeSet" type="InvokeSetType" minOccurs="0" maxOccurs="unbounded"/>
			<xs:element name="While" type="WhileType" minOccurs="0" maxOccurs="unbounded"/>
			<xs:element name="ForEach" type="ForEachType" minOccurs="0" maxOccurs="unbounded"/>
		</xs:sequence>
	</xs:group>
</xs:schema>
